/**
 * DeleteDialog
 */

 var Validator = require("../../../utils/validator/Validator");
 var CommonDialog = require("./CommonDialog");
 var React = require("react");
 var DeleteDialog = React.createClass({
    mixins: [CommonDialog],
    getInitialProps: function (){
        return {
            type: ""
        }
    },
    componentWillMount: function (){
         this.rStyle = {
             position: "fixed",
             top: "40%",
             left: "50%",
             width: "300px",
             height: "auto",
             marginLeft: "-105px",
             display: "block",
             borderRadius: '5px',
             overflow: 'hidden'
         };
         this.buttonsStyle = {
             margin: '0px 10px'
         };
     },
    handleOnDeleteDetails: function (){
        const {removeDetails,type}=this.props;
        removeDetails(type);
        this.handleOnCloseDialog();
    },
    render: function (){
        return (
            <div className="dialog-wrap">
                <div className="dialog-overlay"></div>
                <dialog ref="dialog" style={this.rStyle} className="btg-modal widget-form">
                    <div className="btg-modal-content">
                        <div className="form-horizontal">
                            <div className="widget-form-title">
                                <label>{$._('Delete')}</label>
                            </div>
                            <div className="form-group" style={{width:'100%'}}>
                                {$._("Delete confirm")}
                            </div>
                            <div className="form-group buttons" style={{width:'100%'}}>
                                <button type='button' onClick={this.handleOnCloseDialog} style={this.buttonsStyle}>{$._("Cancel")}</button>
                                <button type="button" onClick={this.handleOnDeleteDetails} style={this.buttonsStyle}>{$._("Confirm")}</button>
                            </div>
                        </div>
                    </div>
                    <a href="#" onClick={this.handleOnCloseDialog} className="modal-close icon-close"></a>
                </dialog>
            </div>
        )
    }
 });

 module.exports = DeleteDialog;
